<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>component manual page - [incr Tcl]</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">[incr Tcl] Package Commands, version 4.2.1</a> <small>&gt;</small> itclcomponent</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<H3><A NAME="M2">NAME</A></H3>
itcl::component &mdash; define components for extendedclass, widget or widgetadaptor
<P>
Parts of this description are &quot;borrowed&quot; from Tcl extension [snit], as the functionality is mostly identical.
<H3><A NAME="M3">WARNING!</A></H3>
This is new functionality in [incr Tcl] where the API can still change!!
<H3><A NAME="M4">SYNOPSIS</A></H3>
<B>public component </B><I>comp</I> ?<B>-inherit</B>?<BR>
<B>protected component </B><I>comp</I> ?<B>-inherit</B>?<BR>
<B>private component </B><I>comp</I> ?<B>-inherit</B>?<BR>
<H3><A NAME="M5">DESCRIPTION</A></H3>
The <B>component</B> command is used inside an <B>[incr&nbsp;Tcl]</B>
extendedclass/widget/widgetadaptor definition to define components.
<P>
Explicitly declares a component called comp, and automatically defines
the component's instance variable.
<P>
If the <I>-inherit</I> option is specified then all unknown methods
and options will be delegated to this component. The name -inherit
implies that instances of this new type inherit, in a sense,
the methods and options of the component. That is,
-inherit yes is equivalent to:
<P>
<PRE>component mycomp
delegate option * to mycomp
delegate method * to mycomp</PRE>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#component">component</A>, <A href="../Keywords/W.htm#widget">widget</A>, <A href="../Keywords/W.htm#widgetadaptor">widgetadaptor</A>, <A href="../Keywords/E.htm#extendedclass">extendedclass</A>
<div class="copy">Copyright &copy; 2008 Arnulf Wiedemann
</div>
</BODY></HTML>
